from django.conf.urls import url
# 导入 views 文件夹中的 视图文件
from .views import IndexViews,UsersViews,TypesViews,GoodsViews,authviews,OrderViews

urlpatterns = [

    # 后台首页
    url(r'^$',IndexViews.index,name="myadmin_index"),

    # 后台权限管理

    # 后台用户添加
    url(r'^auth/user/add/$',authviews.useradd,name="auth_user_add"),
    # 后台用户列表
    url(r'^auth/user/list/$',authviews.userlist,name="auth_user_list"), 
    # 后台用户删除
    url(r'^auth/user/del/(?P<uid>[0-9]+)$',authviews.userdel,name="auth_user_del"), 
    # 后台组的添加
    url(r'^auth/group/add/$',authviews.groupadd,name="auth_group_add"),
    # 后台组列表
    url(r'^auth/group/list/$',authviews.grouplist,name="auth_group_list"),
    # 后台组的修改
    url(r'^auth/group/edit(?P<gid>[0-9]+)/$',authviews.groupedit,name="auth_group_edit"),
    #

    # 后台登录页面
    url(r'^login/$',  IndexViews.mylogin,name="myadmin_login"),
    url(r'^logout/$',  IndexViews.mylogout,name="myadmin_logout"),

# 会员管理
    # 添加
    url(r'^user/add/$',UsersViews.useradd,name="myadmin_user_add"),
    # 执行添加
    url(r'^user/insert/$',UsersViews.userinsert,name="myadmin_user_insert"),
    # 列表页
    url(r'^user/index/$',UsersViews.userindex,name="myadmin_user_index"),
    # 删除
    url(r'^user/del/(?P<uid>[0-9]+)$',UsersViews.userdelete,name='myadmin_user_delete'),
     # 修改
    url(r'^user/edit/(?P<uid>[0-9]+)$',UsersViews.useredit,name='myadmin_user_edit'),
    # 执行修改
    url(r'^user/update/$',UsersViews.userupdate,name='myadmin_user_update'),



# 分类管理
    # 添加
    url(r'^types/add/$', TypesViews.typesadd,name="myadmin_types_add"),
    # 执行添加
    url(r'^types/insert/$',TypesViews.typesinsert,name="myadmin_types_insert"),
    # 列表页
    url(r'^types/index/$',TypesViews.typesindex,name="myadmin_types_index"),
    # 删除
    url(r'^types/delete/$',TypesViews.typesdelete,name="myadmin_types_delete"),
    # 修改
    url(r'^types/update/$',TypesViews.typesupdate,name="myadmin_types_update"),



# 商品管理
    # 添加
    url(r'^goods/add/$',GoodsViews.goodsadd,name="myadmin_goods_add"),
    # 执行添加
    url(r'^goods/insert/$',GoodsViews.goodsinsert,name="myadmin_goods_insert"),
    # 列表页
    url(r'^goods/index/$',GoodsViews.goodsindex,name="myadmin_goods_index"),
    # 删除
    url(r'^goods/delete/(?P<uid>[0-9]+)/$',GoodsViews.goodsdelete,name="myadmin_goods_delete"),
    # 重新编辑
    url(r'goods/edit/(?P<uid>[0-9]+)/$',GoodsViews.goodsedit,name="myadmin_goods_edit"),
    # 执行修改
    url(r'^goods/update/$',GoodsViews.goodsupdate,name="myadmin_goods_update"),


    # 订单管理
    url(r'^order/list/$',OrderViews.orderlist,name="myadmin_order_list")

]   